package cn.sxt.common.test;

import java.util.Map;
import java.util.concurrent.Callable;

import cn.sxt.questions.service.IQuestionSpiderService;

public class MultiThreadUtil implements Callable<Object>{
	private String name;
	/* 参数 */
	private Map<String,Object> paramsMap;
	
	public MultiThreadUtil(String name){
		super();
		this.name=name;
	}

	@Override
	public Object call() throws Exception {
		String operType=paramsMap.get("operType")+"";
		if("spliderColumns".equalsIgnoreCase(operType)){
			/* 为指定的栏目采集数据 */
			this.spliderColumns(paramsMap);
		}
		return null;
	}
	
	public Map<String, Object> getParamsMap() {
		return paramsMap;
	}

	public void setParamsMap(Map<String, Object> paramsMap) {
		this.paramsMap = paramsMap;
	}

	private void spliderColumns(Map<String,Object> paramsMap){
		/* 取到栏目的url */	
		String url=paramsMap.get("url")+"";
		IQuestionSpiderService questionSpiderService=(IQuestionSpiderService)paramsMap.get("questionSpiderService");
		questionSpiderService.saveBatchItemsBak(url);
	}

}
